package com.tl.boot.entity.menu.form;

import com.tl.boot.common.enums.ResultEnum;
import com.tl.boot.common.exception.BaseException;
import com.tl.boot.entity.demo.form.Base.BaseForm;
import io.swagger.annotations.ApiModelProperty;

/**
 * com.tl.boot.entity.menu.form -- UpdateMenuBindResourceForm
 * Description:
 * Created by joshua_liu <a href="mailto:joshualwork@163.com"></a>
 * On 2019/9/19 17:52
 */
public class UpdateMenuBindResourceForm extends BaseForm {
    @ApiModelProperty(value = "菜单id",name = "menuId",example = "1",dataType = "Long",required = true)
    private Long menuId;
    @ApiModelProperty(value = "菜单资源关系id",name = "mrId",example = "1",dataType = "Long")
    private Long mrId;
    @ApiModelProperty(value = "原绑定资源id",name = "sourceResourceId",example = "1",dataType = "Long")
    private Long sourceResourceId;
    @ApiModelProperty(value = "将要绑定的资源id",name = "targetResourceId",example = "1",dataType = "Long",required = true)
    private Long targetResourceId;

    public Long getMrId() {
        return mrId;
    }

    public void setMrId(Long mrId) {
        this.mrId = mrId;
    }

    public Long getMenuId() {
        return menuId;
    }

    public void setMenuId(Long menuId) {
        this.menuId = menuId;
    }

    public Long getSourceResourceId() {
        return sourceResourceId;
    }

    public void setSourceResourceId(Long sourceResourceId) {
        this.sourceResourceId = sourceResourceId;
    }

    public Long getTargetResourceId() {
        return targetResourceId;
    }

    public void setTargetResourceId(Long targetResourceId) {
        this.targetResourceId = targetResourceId;
    }

    @Override
    public void checkParam() {
        if (this.menuId == null || this.targetResourceId == null) {
            throw new BaseException(ResultEnum.REQUEST_PARAM_ILLEGAL);
        }
    }
}
